export default class Stategy{
    constructor(){
        this.caches = [];
        this.stategies={
            "age":function(value){
                return value > 18;
            },
            "height":function(value){
                return  value > 180;
            }
        }
    }
   add(method,value){
       //放入的函数
        this.caches.push(()=>this.stategies[method](value));
   }
   check(){
        return this.caches.every((e)=>{
            return e();
        })
   }
}